Optimal. Leaf size=39 \[ -a x+\frac {a \cos (c+d x)}{d}+\frac {a \cos (c+d x)}{d (1-\sin (c+d x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.08, antiderivative size = 39, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.263, Rules used = {2787, 2825, 12,
2814, 2727} \begin {gather*} \frac {a \cos (c+d x)}{d}+\frac {a \cos (c+d x)}{d (1-\sin (c+d x))}-a x \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 2727
Rule 2787
Rule 2814
Rule 2825
Rubi steps
\begin {align*} \int (a+a \sin (c+d x)) \tan ^2(c+d x) \, dx &=a^2 \int \frac {\sin ^2(c+d x)}{a-a \sin (c+d x)} \, dx\\ &=\frac {a \cos (c+d x)}{d}+a \int \frac {a \sin (c+d x)}{a-a \sin (c+d x)} \, dx\\ &=\frac {a \cos (c+d x)}{d}+a^2 \int \frac {\sin (c+d x)}{a-a \sin (c+d x)} \, dx\\ &=-a x+\frac {a \cos (c+d x)}{d}+a^2 \int \frac {1}{a-a \sin (c+d x)} \, dx\\ &=-a x+\frac {a \cos (c+d x)}{d}+\frac {a^2 \cos (c+d x)}{d (a-a \sin (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.03, size = 47, normalized size = 1.21 \begin {gather*} -\frac {a \tan ^{-1}(\tan (c+d x))}{d}+\frac {a \cos (c+d x)}{d}+\frac {a \sec (c+d x)}{d}+\frac {a \tan (c+d x)}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.13, size = 59, normalized size = 1.51
method | result | size |
risch | \(-a x +\frac {a \,{\mathrm e}^{i \left (d x +c \right )}}{2 d}+\frac {a \,{\mathrm e}^{-i \left (d x +c \right )}}{2 d}+\frac {2 a}{d \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}\) | \(56\) |
derivativedivides | \(\frac {a \left (\frac {\sin ^{4}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )\right )+a \left (\tan \left (d x +c \right )-d x -c \right )}{d}\) | \(59\) |
default | \(\frac {a \left (\frac {\sin ^{4}\left (d x +c \right )}{\cos \left (d x +c \right )}+\left (2+\sin ^{2}\left (d x +c \right )\right ) \cos \left (d x +c \right )\right )+a \left (\tan \left (d x +c \right )-d x -c \right )}{d}\) | \(59\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.51, size = 39, normalized size = 1.00 \begin {gather*} -\frac {{\left (d x + c - \tan \left (d x + c\right )\right )} a - a {\left (\frac {1}{\cos \left (d x + c\right )} + \cos \left (d x + c\right )\right )}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 80 vs.
\(2 (38) = 76\).
time = 0.34, size = 80, normalized size = 2.05 \begin {gather*} -\frac {a d x - a \cos \left (d x + c\right )^{2} + {\left (a d x - 2 \, a\right )} \cos \left (d x + c\right ) - {\left (a d x - a \cos \left (d x + c\right ) + a\right )} \sin \left (d x + c\right ) - a}{d \cos \left (d x + c\right ) - d \sin \left (d x + c\right ) + d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} a \left (\int \sin {\left (c + d x \right )} \tan ^{2}{\left (c + d x \right )}\, dx + \int \tan ^{2}{\left (c + d x \right )}\, dx\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 1008 vs.
\(2 (38) = 76\).
time = 7.40, size = 1008, normalized size = 25.85 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 6.77, size = 111, normalized size = 2.85 \begin {gather*} \frac {\left (a\,\left (c+d\,x-2\right )-a\,\left (c+d\,x\right )\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+\left (a\,\left (c+d\,x\right )-a\,\left (c+d\,x-2\right )\right )\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-a\,\left (c+d\,x\right )+a\,\left (c+d\,x-4\right )}{d\,\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-1\right )\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}-a\,x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________